home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-09-30 | 2.3 KB | 98 lines | [TEXT/ExPr] |
- * define a submenu
- *
- x = 'abc def ghijk/3<I lm'
- lval x,submenu
- menu new,21,-1,submenu
- *
- * define a sample menu and add to menu bar
- *
- menuscript 21,'MenuResponse'
- *
- * the dialog template is stored in the following file
- rfopen 'dialog resources'
- *
- * the dialog displays the list $ll created from a user selected directory
- *
- dir
- listdir $ll
- list $ll
- *
- * items 3 & 4 form Group A Radio Buttons
- * items 6 & 7 form Group A Radio Buttons
- *
- $dloglist[1] = 'dOK'
- $dloglist[2] = 'rReset'
- $dloglist[3] = 'eGroup A #1'
- $dloglist[4] = 'sGroup A #2'
- $dloglist[5] = ''
- $dloglist[6] = 'sGroup B #1'
- $dloglist[7] = 'eGroup B #2'
- $dloglist[8] = ''
- $dloglist[9] = 'item 9 initial text'
- $dloglist[10] = ''
- $dloglist[11] = 'item 11 initial text'
- $dloglist[12] = ''
- *
- * item 13 is a pop-up menu initialised to show the second item in the list
- *
- menuset 20,2
- $dloglist[13] = 21
- $dloglist[14] = 'epop-up:'
- *
- * item 15 is the directory list with the following attributes
- * preselection (2nd character is lowercase)
- * select multiple items (3rd & 4th characters are 00)
- * single click does an update and reset
- * double click processed by script but no update or reset
- *
- $dloglist[15] = 'yb00$ll'
- *
- * item 16 is an arbitrary list with the following attributes
- * no preselection (2nd character is uppercase)
- * select one item only (3rd & 4th characters are 80)
- * single click does an update and reset
- * double click looks like OK button
- *
- $dloglist[16] = 'oB80$aaa'
- x = '"item 1" "item 2" "item 3"'
- lval x,$aaa
- *
- *show the dialog
- *
- modeless new,11,'ModeScript',$dloglist
- modeless show,11
- debug off
- *
- script MenuResponse
- display 'MenuResponse: ' #arg(1)':'#arg(2)
- *
- script ModeScript
- display 'Start ModeScript: ' #arg(1)':'#arg(2)
-
- if #arg(1) = 1
- disp '** Dialog State **'
- x = 1
- test ($dloglist[4](1) = 's') x = 2
- disp 'Button #'x' selected in Group 1'
- x = 1
- test ($dloglist[7](1) = 's') x = 2
- disp 'Button #'x' selected in Group 2'
- if $dloglist[5](1) = 's'
- disp 'Check Box Selected'
- else
- disp 'Check Box Not Selected'
- end
- disp 'First Text Edit Item: '$dloglist[9]
- disp 'Second Text Edit Item: '$dloglist[11]
- else if #arg(1) = 2
- display 'Reset selected: Edit items will be reset'
- else if #arg(1) >= 15
- if $aaa[-1] > 0 && $ll[-1] > 0
- test ($dloglist[1](1) = 'd') $dloglist[1](1) = 'B'
- else
- test ($dloglist[1](1) = 'b') $dloglist[1](1) = 'D'
- end
- end
-
- display 'End ModeScript'
-